package CI.aufgabe2.cip.mynodes;

import CI.aufgabe2.cip.SymbolTable;
import CI.aufgabe2.cip.base.AbstractDescr;

public class MyStrNode extends MyAbstractNode {

	private static final long serialVersionUID = 1L;

	String strval;
	
	public MyStrNode() {
		strval = "";
			};

	public MyStrNode(String fi) {
		strval = fi;
	};

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((strval == null) ? 0 : strval.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MyStrNode other = (MyStrNode) obj;
		if (strval == null) {
			if (other.strval != null)
				return false;
		} else if (!strval.equals(other.strval))
			return false;
		return true;
	}

	public void print() {
		trace("MyStrNode " + strval);
		unindent();
	};
	
	
	
	public AbstractDescr compile(SymbolTable sym) {
		try {
			throw new  IllegalAccessException(this.getClass().getName());
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
